<?php
    $getMessagePackageCount = 0;
    if (!empty($getMessagePackageData) && $getMessagePackageData['data']['count']>0) {

        $getMessagePackageCount = $getMessagePackageData['data']['count'];
        echo <<<PACKAGENUM
        <div class="remand-list-nav clearfix">
    <span class="pull-left nav-l">关注提醒</span>
</div>
<div class="remand-list-nav">
    <span class="nav-s">您关注的如下 $getMessagePackageCount 个资产包数据有更新</span>
</div>
PACKAGENUM;
    }
?>

<div class="remand-list-content clearfix">
<?php
    if (!empty($getMessagePackageData) && $getMessagePackageData['data']['count']>0) {
        foreach ($getMessagePackageData['data']['res'] as $k => $v) {
            $num = $k+1;
            $user_id = !empty($v['user_id'])?$v['user_id']:0;
            $package_project_id = !empty($v['package_project_id'])?$v['package_project_id']:0;
            $message_user_group_id = !empty($v['message_user_group_id'])?$v['message_user_group_id']:0;
            $message_val = !empty($v['message_val'])?json_decode($v['message_val'],true):'';
            $title = !empty($message_val['pack_name']['title'])?$message_val['pack_name']['title']:'';
            $appStates = !empty($message_val['appStates']['name'])?$message_val['appStates']['name']:'';
            $userName = !empty($message_val['lastUpdateUser'])?$message_val['lastUpdateUser']:'';
            $userBumen = !empty($message_val['lastUpdateUserBumen'])?$message_val['lastUpdateUserBumen']:'';
            $isView = \backend\controllers\DtActionFilter::checkPackage('package_view',$user_id);
            if ($isView){
                $packageUrl = "/package/detail-info?packageid=$package_project_id&message_state=2&message_user_group_id=$message_user_group_id&user_id=$user_id&follow=1";
            }else{
                $packageUrl = "#";
            }
            if ($num<=10){
            echo <<<LIKEPACKAGE
    <span>$num 资产包名称： <font> <a href="$packageUrl">$title</a></font></span>
    <span>当前状态： <font>$appStates </font></span>
    <span>最后一次更新人员： <font>$userName-$userBumen</font></span>
    <div class="pull-right qcl">
        <img src="/image/officeHall/qwck.png" class="pull-left qwck" style="margin:7px 5px 0;"> 
        <a href="$packageUrl"><span class="pull-left ">前往查看</span></a>
    </div>
    </br>
LIKEPACKAGE;
            }
        }
    }
?>
</div>
<?php
$getMessageProjectCount = 0;
if (!empty($getMessageProjectData) && $getMessageProjectData['data']['count']>0) {
    $getMessageProjectCount = $getMessageProjectData['data']['count'];
    echo <<<PROJECTNUM
<div class="remand-list-nav">
    <span class="nav-s">您关注的如下 $getMessageProjectCount 个项目数据有更新</span>
</div>
PROJECTNUM;
}
?>
<div class="remand-list-content clearfix">
    <?php
    if (!empty($getMessageProjectData) && $getMessageProjectData['data']['count']>0) {
        foreach ($getMessageProjectData['data']['res'] as $k => $v) {
            $num = $k+1;
            $user_id = !empty($v['user_id'])?$v['user_id']:0;
            $package_project_id = !empty($v['package_project_id'])?$v['package_project_id']:0;
            $message_user_group_id = !empty($v['message_user_group_id'])?$v['message_user_group_id']:0;

            $message_val = !empty($v['message_val'])?json_decode($v['message_val'],true):'';
            $title = !empty($message_val['pack_name']['title'])?$message_val['pack_name']['title']:'';
            $appStates = !empty($message_val['appStates']['name'])?$message_val['appStates']['name']:'';
            $userName = !empty($message_val['lastUpdateUser'])?$message_val['lastUpdateUser']:'';
            $userBumen = !empty($message_val['lastUpdateUserBumen'])?$message_val['lastUpdateUserBumen']:'';
            if ($num<=10){
                $isView = \backend\controllers\DtActionFilter::checkPackage('package_view',$user_id);
                if ($isView){
                    $package_id = (new \yii\db\Query())->from('project')->where(['=','id',$package_project_id])->one()['package_id'];
                    $projectUrl = "/project/getinfodata?package_id=$package_id&project_id=$package_project_id&message_state=2&message_user_group_id=$message_user_group_id&user_id=$user_id&follow=1";
                }else{
                    $projectUrl = "#";
                }
                echo <<<LIKEPACKAGE
    <span>$num 项目名称： <font> <a href="$projectUrl">$title</a></font></span>
    <span>当前状态： <font>$appStates </font></span>
    <span>最后一次更新人员： <font>$userName-$userBumen</font></span>
    <div class="pull-right qcl">
        <img src="/image/officeHall/qwck.png" class="pull-left qwck" style="margin:7px 5px 0;">
        <a href="$projectUrl"><span class="pull-left ">前往查看</span></a>
    </div>
    </br>
LIKEPACKAGE;
            }
        }
    }
    ?>
</div>
